from bs4 import BeautifulSoup

soup = BeautifulSoup(open("/home/hdp/Desktop/test/demo2.html"), "html.parser")

# print (soup.prettify()) #格式化 打印出soup对象中的内容
print (soup.title) # 打印标题
print(soup.a)
print(soup.p)
# print(soup.body)


